package com.cobo.common.core;

import lombok.Data;

@Data
public class R<T> {

    private Integer code;

    private String message;

    private T data;

    public static R ok(Object t) {
        R r = new R();
        r.setCode(200);
        r.setMessage("");
        r.setData(t);
        return r;
    }

    public static R ok() {
        R r = new R();
        r.setCode(200);
        r.setMessage("");
        return r;
    }

    public static R failed(String message) {
        R r = new R();
        r.setCode(500);
        r.setMessage(message);
        return r;
    }
}
